function (test_file filename)
    add_executable(${filename} ${filename}.cpp doctest.h)
    target_link_libraries(${filename} ${PROJECT_NAME} ${PROJECT_NAME}_compiler_flags)
    set_property(TARGET ${filename} PROPERTY FOLDER "test")
    add_test(NAME ${filename}_test COMMAND $<TARGET_FILE:${filename}>)
endfunction(test_file)

test_file(address)
test_file(userdata)
test_file(utils)
